package com.timber.util;

import java.sql.*;
public class ITPContractCorrection extends SLDataObjectAdaptor
{
  private String contractField;
  private String newTradeCashAmend;
  private String newTradeCashChange;
  private String newTradeNonCashAmend;
  private String newTradeNonCashChange;
  private String newTradeCashPoolAmend;
  private String newTradeCashPoolChange;
  private String newCollateralNonCashAmend;
  private String newCollateralNonCashChange;
  private String returnTradeCashAmend;
  private String returnTradeNonCashAmend;
  private String returnTradeCashPoolAmend;
  private String returnCollateralNonCashAmend;

  public static final String CONTRACT_FIELD               = "ContractField";
  public static final String TRADE_CASH_AMEND             = "NewTradeCashAmend";
  public static final String TRADE_CASH_CHANGE            = "NewTradeCashChange";
  public static final String TRADE_NONCASH_AMEND          = "NewTradeNonCashAmend";
  public static final String TRADE_NONCASH_CHANGE         = "NewTradeNonCashChange";
  public static final String TRADE_CASHPOOL_AMEND         = "NewTradeCashPoolAmend";
  public static final String TRADE_CASHPOOL_CHANGE        = "NewTradeCashPoolChange";
  public static final String TRADE_COLL_NONCASH_AMEND     = "NewCollateralNonCashAmend";
  public static final String TRADE_COLL_NONCASH_CHANGE    = "NewCollateralNonCashChange";
  public static final String RETURN_CASH_AMEND            = "ReturnTradeCashAmend";
  public static final String RETURN_NONCASH_AMEND         = "ReturnTradeNonCashAmend";
  public static final String RETURN_CASHPOOL_AMEND        = "ReturnTradeCashPoolAmend";
  public static final String RETURN_COLL_NONCASH_AMEND    = "ReturnCollateralNonCashAmend";


  public static final String ENTITY                       = "Entity";
  public static final String BORROW_LOAN                  = "BorrowLoan";
  public static final String CPTY                         = "Cpty";
  public static final String SECURITY                     = "Security";
  public static final String COLL_TYPE                    = "CollateralType";
  public static final String CALLABLE                     = "Callable";
  public static final String QUANTITY                     = "Quantity";
  public static final String PRICE                        = "MarkPrice";
  public static final String VALUE                        = "Value";
  public static final String VALUE_CCY                    = "ValueCcy";
  public static final String RATE                         = "Rate";
  public static final String TRADE_DATE                   = "OpenDate";
  public static final String SEC_SETTLE_DATE              = "SecSettleDate";
  public static final String SEC_SETTLE_MODE              = "SecSettleMode";
  public static final String DVP                          = "Dvp";
  public static final String CASH_SETTLE_DATE             = "CashSettleDate";
  public static final String CASH_SETTLE_MODE             = "CashSettleMode";
  public static final String RECALLED                     = "RecalledInd";
  public static final String COMMENT                      = "Comment";
  public static final String TRADE_CATEGORY               = "TradeCategory";
  public static final String AUTO_SETTLE                  = "AutoSettleInd";
  public static final String EXTERNAL_COMMENT             = "ExternalComment";
  public static final String FINDER_CPTY                  = "FinderCpty";
  public static final String FINDER_FEE                   = "FinderFee";
  public static final String CASH_POOL_VALUE              = "CashPoolValue";
  public static final String TERM_DATE                    = "TermDate";
  public static final String LINK_REF                     = "LinkRef";
  public static final String COLL_HAIRCUT                 = "CollateralHaircut";
  public static final String NET_DIVIDEND                 = "NetDividendPct";
  public static final String OVERSEAS_TAX                 = "OverseasTaxPct";
  public static final String MARK_TRADE                   = "MarkTradeInd";
  public static final String COLL_MARGIN                  = "CollateralMargin";
  public static final String MIN_FEE                      = "MinimumFee";
  public static final String MIN_FEE_CCY                  = "MinimumFeeCcy";
  public static final String BOOK                         = "Book";
  public static final String INTERCO_BOOK                 = "InterCmpyBook";
  public static final String ALL_IN_RATE                  = "AllInRate";
  public static final String ALL_IN_AGREED_DIV            = "AllInAgreedDiv";
  public static final String ALL_IN_REPRICE_DIV           = "AllInRepriceDivInd";
  public static final String TAX_STATUS                   = "TaxStatus";
  public static final String INDEX_STOCK                  = "IndexStockInd";
  public static final String DNI                          = "DNIInd";
  public static final String GUARANTEED                   = "GuaranteedInd";
  public static final String ALLOCATION                   = "Allocation";


  public boolean load(ResultSet rs) throws SQLException
  {
    contractField               = rs.getString( CONTRACT_FIELD );
    newTradeCashAmend           = rs.getString( TRADE_CASH_AMEND );
    newTradeCashChange          = rs.getString( TRADE_CASH_CHANGE );
    newTradeNonCashAmend        = rs.getString( TRADE_NONCASH_AMEND);
    newTradeNonCashChange       = rs.getString( TRADE_NONCASH_CHANGE);
    newTradeCashPoolAmend       = rs.getString( TRADE_CASHPOOL_AMEND );
    newTradeCashPoolChange      = rs.getString( TRADE_CASHPOOL_CHANGE );
    newCollateralNonCashAmend   = rs.getString( TRADE_COLL_NONCASH_AMEND);
    newCollateralNonCashChange  = rs.getString( TRADE_COLL_NONCASH_CHANGE );
    returnTradeCashAmend        = rs.getString( RETURN_CASH_AMEND );
    returnTradeNonCashAmend     = rs.getString( RETURN_NONCASH_AMEND );
    returnTradeCashPoolAmend    = rs.getString( RETURN_CASHPOOL_AMEND);
    returnCollateralNonCashAmend = rs.getString( RETURN_COLL_NONCASH_AMEND );

    return true;

  }

  public String getContractField()              { return contractField;}

  public String getNewTradeCashAmend()          { return newTradeCashAmend;}

  public String getNewTradeCashChange()         { return newTradeCashChange;}

  public String getNewTradeNonCashAmend()       { return newTradeNonCashAmend;}

  public String getNewTradeNonCashChange()      { return newTradeNonCashChange;}

  public String getNewTradeCashPoolAmend()      { return newTradeCashPoolAmend;}

  public String getNewTradeCashPoolChange()     { return newTradeCashPoolChange;}

  public String getNewCollateralNonCashAmend()  { return newCollateralNonCashAmend;}

  public String getNewCollateralNonCashChange() { return newCollateralNonCashChange;}

  public String getReturnTradeCashAmend()       { return returnTradeCashAmend;}

  public String getReturnTradeNonCashAmend()    { return returnTradeNonCashAmend;}

  public String getReturnTradeCashPoolAmend()   { return returnTradeCashPoolAmend;}

  public String getReturnCollateralNonCashAmend() { return returnCollateralNonCashAmend;}





















  public Object hashKey()
  {
      StringBuffer hk = new StringBuffer();

      hk.append( contractField);

      return   hk.toString();
  }

  public String toString()
  {
      StringBuffer printObj = new StringBuffer();

      printObj.append( CONTRACT_FIELD + ":" + contractField + "\n");
      printObj.append( TRADE_CASH_AMEND + ":" + newTradeCashAmend + "\n");
      printObj.append( TRADE_CASH_CHANGE + ":" + newTradeCashChange + "\n");
      printObj.append( TRADE_NONCASH_AMEND + ":" + newTradeNonCashAmend + "\n");
      printObj.append( TRADE_NONCASH_CHANGE + ":" + newTradeNonCashChange + "\n");
      printObj.append( TRADE_CASHPOOL_AMEND + ":" + newTradeCashPoolAmend + "\n");
      printObj.append( TRADE_CASHPOOL_CHANGE + ":" + newTradeCashPoolChange + "\n");
      printObj.append( TRADE_COLL_NONCASH_AMEND + ":" + newCollateralNonCashAmend + "\n");
      printObj.append( TRADE_COLL_NONCASH_CHANGE + ":" + newCollateralNonCashChange + "\n");
      printObj.append( RETURN_CASH_AMEND + ":" + returnTradeCashAmend + "\n");
      printObj.append( RETURN_NONCASH_AMEND + ":" + returnTradeNonCashAmend + "\n");
      printObj.append( RETURN_CASHPOOL_AMEND + ":" + returnTradeCashPoolAmend + "\n");
      printObj.append( RETURN_COLL_NONCASH_AMEND + ":" + returnCollateralNonCashAmend + "\n");

      return   printObj.toString();

  }








}